<h2>유저 목록 </h2>
<div class="content-box">
<table class="list">
  <tr>
    <th>로그인 아이디 </th>
    <th>이름</th>
    <th>사용여부</th>
    <th></th>
  </tr>
  
<% for user in @users %>
  <tr>
    <td>
        <%= user.login_id %>
    </td>
    <td>
        <%= user.name %>
    </td>
    <td>
        <%= (user.fl_enable == 1 ? "사용" : "사용못함" )  %>
    </td>
    <td>
    <%= link_to 'Show', :action => 'show', :id => user %>
    <%
        if(session[:user_id] == user.id)
    %>
    &nbsp;<%= link_to 'Edit', :action => 'edit', :id => user %>
    &nbsp;<%= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :post => true %>
    <%
        end
    %>        
    </td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @user_pages.current.previous } if @user_pages.current.previous %>
<%= link_to 'Next page', { :page => @user_pages.current.next } if @user_pages.current.next %> 

</div>
